package BaseObject;

/**
 * ClassName: RecursionExercise02
 * Package: BaseObject
 * Description: 猴子吃桃子
 *
 * @Author Linshio
 * @Create 2025/3/9 21:49
 */
public class RecursionExercise02 {
    public static void main(String[] args) {
        System.out.println("monkeyEatPatch(1) = " + monkeyEatPatch(1));
    }

    public static int monkeyEatPatch(int day) {
        if (day == 10) {
            return 1;
        } else {
            return (monkeyEatPatch(day + 1) + 1) * 2;
        }
    }
}
